﻿<Window x:Class="ControlTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        TextOptions.TextFormattingMode="Display"
        Title="MainWindow" Height="350" Width="525" xmlns:my="clr-namespace:ChromaCode;assembly=ChromaCode">
    <StackPanel>
        <my:ChromaCode x:Name="syntaxHighlighter" DocumentText="{Binding TestText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="280"
                       FontFamily="Courier New">
            <my:ChromaCode.Resources>
                <Style TargetType="{x:Type Paragraph}">
                    <Setter Property="Margin" Value="0"/>
                </Style>
            </my:ChromaCode.Resources>

        </my:ChromaCode>

        <StackPanel Orientation="Horizontal">
            <Button Click="Button_Click">Type some text then click me!</Button>
            <Button Name="btnToggleHighlight" Click="btnToggleHighlight_Click">Toggle Highlighting</Button>
            <Button Command="Cut" CommandTarget="{Binding ElementName=syntaxHighlighter}">Cut</Button>
            <Button Command="Copy" CommandTarget="{Binding ElementName=syntaxHighlighter}">Copy</Button>
            <Button Command="Paste" CommandTarget="{Binding ElementName=syntaxHighlighter}">Paste</Button>
        </StackPanel>
    </StackPanel>
</Window>
